package com.googlecode.gwtbb.client.shared.entity.forum;

import com.googlecode.gwtbb.client.shared.entity.properties.HasSnapDate;
import com.googlecode.gwtbb.client.shared.entity.properties.HasUserId;

import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Apr 17, 2008
 */
public class PostBase implements HasSnapDate, HasUserId, Serializable {
	public static final String POST_ID = "postId";
	public static final String THREAD_ID = "threadId";
	public static final String FORUM_ID = "forumId";
	public static final String SUBJECT = "subject";
	public static final int SUBJECT_MAX = 80;
	public static final String BODY = "body";
	public static final int BODY_MAX = 8000;

	public static final List<String> PROPERTIES = Collections.unmodifiableList(Arrays.asList(
		POST_ID,
		THREAD_ID,
		FORUM_ID,
		USER_ID,
		SUBJECT,
		BODY,
		SNAP_DATE
	));

	protected Long postId;
	protected Long threadId;
	protected Long forumId;
	protected Long userId;
	protected String subject;
	protected String body;
	protected Date snapDate;

	public PostBase() {
	}

	public PostBase(Long postId, Long threadId, Long forumId, Long userId, String subject, String body, Date snapDate) {
		this.postId = postId;
		this.threadId = threadId;
		this.forumId = forumId;
		this.userId = userId;
		this.subject = subject;
		this.body = body;
		this.snapDate = snapDate;
	}

	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}

	public Long getForumId() {
		return forumId;
	}

	public void setForumId(Long forumId) {
		this.forumId = forumId;
	}

	public Long getPostId() {
		return postId;
	}

	public void setPostId(Long postId) {
		this.postId = postId;
	}

	public Date getSnapDate() {
		return snapDate;
	}

	public void setSnapDate(Date snapDate) {
		this.snapDate = snapDate;
	}

	public String getSubject() {
		return subject;
	}

	public void setSubject(String subject) {
		this.subject = subject;
	}

	public Long getThreadId() {
		return threadId;
	}

	public void setThreadId(Long threadId) {
		this.threadId = threadId;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}
}